import { IParam } from '../../common';
import { ICalendarAbility } from '../ability';
import { ICtrlActionResult } from '../data-action';
import { ICalendarStore } from '../store';
import { IMDCtrlController } from './i-md-ctrl-controller';

/**
 * 日历部件控制器接口
 *
 * @export
 * @interface ICalendarController
 * @extends {ICtrlController}
 */
export interface ICalendarController<
	S extends ICalendarStore,
	A extends ICalendarAbility
> extends IMDCtrlController<S, A> {
	/**
	 * 日历数据加载
	 *
	 * @param {IParam} [opts]
	 * @return {*}  {Promise<void>}
	 * @memberof ICalendarController
	 */
	load(opts?: IParam): Promise<ICtrlActionResult | void>;

	/**
	 * 获取事件key
	 *
	 * @param {IParam} [opts]
	 * @memberof ICalendarController
	 */
	getEventKey(event: any): string | undefined;

	/**
	 * 日程点击事件
	 *
	 * @param {*} arg calendar事件对象或event数据
	 * @param {*} isOriginData true：$event是原始event数据，false：是组件
	 * @memberof ICalendarController
	 */
	onEventClick(arg: IParam, isOriginData?: boolean): void;

	/**
	 * 设置是否已经选中第一项
	 *
	 * @param {*} info 信息
	 * @memberof ICalendarController
	 */
	setIsSelectFirst(info: boolean): void;

	/**
	 * 是否已经选中第一条数据
	 *
	 * @type {boolean}
	 * @memberof ICalendarController
	 */
	isSelectFirst: boolean;

	/**
	 * 时间轴点击事件
	 *
	 * @param {*} item 项数据
	 * @memberof ICalendarController
	 */
	onTimeLineClick(item: any): void;
}
